# Maintainer: Jaroslav Lichtblau <svetlemodry@archlinux.org>

pkgname=bmon
pkgver=4.0
pkgrel=4
pkgdesc="Portable bandwidth monitor and rate estimator"
arch=('loong64' 'x86_64')
url="https://github.com/tgraf/bmon/"
license=('MIT' 'BSD')
depends=('ncurses' 'libnl' 'confuse')
makedepends=('autoconf')
source=($pkgname-$pkgver.tar.gz::https://github.com/tgraf/$pkgname/archive/v$pkgver.tar.gz)
sha256sums=('d5e503ff6b116c681ebf4d10e238604dde836dceb9c0008eb92416a96c87ca40')

build() {
  cd "${srcdir}"/$pkgname-$pkgver

  ./autogen.sh
  ./configure --prefix=/usr --sysconfdir=/etc
  make
}

package() {
  cd "${srcdir}"/$pkgname-$pkgver

  make DESTDIR="${pkgdir}" install

# Licenses
  install -d "${pkgdir}"/usr/share/licenses/$pkgname
  cp LICENSE.{BSD,MIT} "${pkgdir}"/usr/share/licenses/$pkgname
}
